package com.dhcc.bpm.modules.api.service.impl;

import com.dhcc.bpm.modules.api.entity.BaseProduct;
import com.dhcc.bpm.modules.api.vo.BaseProductVO;
import com.dhcc.bpm.modules.api.mapper.BaseProductMapper;
import com.dhcc.bpm.modules.api.service.IBaseProductService;
import com.dhcc.bpm.modules.common.vo.SelectVo;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;

import java.util.List;

/**
 * @ClassName BaseProductServiceImpl
 * @Description 基础产品表 服务实现类
 * @Author daina
 * @Date 2020/2/25 15:22
 * @Version V1.0
 * @Copyright: 2020 东华软件 . All rights reserved.
 */
@Service("opc_base_product")
public class BaseProductServiceImpl extends BaseServiceImpl<BaseProductMapper, BaseProduct> implements IBaseProductService {
	@Autowired
	private BaseProductMapper baseProductMapper;
	@Override
	public IPage<BaseProductVO> selectBaseProductPage(IPage<BaseProductVO> page, BaseProductVO baseProduct) {
		return page.setRecords(baseMapper.selectBaseProductPage(page, baseProduct));
	}

	@Override
	public IPage<BaseProductVO> selectBProductList(IPage page, BaseProductVO baseProduct) {
		return page.setRecords(baseMapper.selectBProductList(page, baseProduct));
	}

	public List<SelectVo> selectBaseProductName() {
		return baseMapper.selectBaseProductName();
	}

	@Override
	public List<BaseProductVO> selectBySysNum(String productNum) {
		return baseMapper.selectBySysNum(productNum);
	}

	/**
	 * @Description 根据所属id查询集合
	 * @Author sjm
	 * @Date 18:00 2020/3/28 0028
	 * @param opcSysId
	 * @return java.util.List<com.dhcc.bpm.modules.api.entity.BaseProduct>
	 **/
	@Override
	public List<BaseProduct> selectBySysId(Long opcSysId) {
		return baseMapper.selectBySysId(opcSysId);
	}

	@Override
	public List<BaseProduct> selectById(Long id) {
		return baseMapper.selectById(id);
	}

	@Override
	public List<BaseProductVO> selectBackById(Long id) {
		return baseProductMapper.selectBackById(id);
	}

	@Override
	public int updateOpcBaseProduct(BaseProductVO baseProduct) {
		return baseMapper.updateOpcBaseProduct(baseProduct);
	}

	@Override
	public List<BaseProductVO> selectBaseProductList() {
		return baseProductMapper.selectBaseProductList();
	}

	@Override
	public IPage<BaseProductVO> selectThirdBaseProductPage(IPage<BaseProductVO> page, BaseProductVO baseProduct) {
		return page.setRecords(baseMapper.selectThirdBProductList(page, baseProduct));
	}

}
